﻿//-----------------------------------------------------------------------
// <copyright file="ItemList.cs" company="Forebrain Technology, LLC">
//
// Copyright (c) Forebrain Technology, LLC. All rights reserved.
// 
// This source code is released under the Microsoft Public License (Ms-PL).
//
// </copyright>
//-----------------------------------------------------------------------
namespace PivotCollectionTools.Xml
{
    using System;
    using System.Collections.ObjectModel;
    using System.Xml.Serialization;

    /// <summary>
    /// A collection of items.
    /// </summary>
    [SerializableAttribute()]
    [XmlType(Namespace = "http://schemas.microsoft.com/collection/metadata/2009")]
    public class ItemList : XmlNodeBase
    {
        /// <summary>
        /// A collection used to store the item objects.
        /// </summary>
        private Collection<Item> items;

        /// <summary>
        /// Initializes a new instance of the <see cref="ItemList"/> class.
        /// </summary>
        public ItemList()
        {
            this.items = new Collection<Item>();
        }

        /// <summary>
        /// Gets the items.
        /// </summary>
        /// <value>The items of the item collection.</value>
        [XmlElementAttribute("Item")]
        public Collection<Item> Items
        {
            get
            {
                return this.items;
            }
        }

        /// <summary>
        /// Gets or sets the image base.
        /// </summary>
        /// <value>The image base of the item collection.</value>
        [XmlAttributeAttribute(DataType = "anyURI", AttributeName = "ImgBase")]
        public string ImageBase { get; set; }

        /// <summary>
        /// Gets or sets the href base.
        /// </summary>
        /// <value>The href base of the item collection.</value>
        [XmlAttributeAttribute(DataType = "anyURI")]
        public string HrefBase { get; set; }
    }
}
